package com.jash.labor.controller;

import com.jash.labor.entity.FirstParty;
import com.jash.labor.service.FirstPartyService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.sql.Date;

@RestController
@RequestMapping(value = "/firstParty", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class FirstPartyController {
    @Resource
    private FirstPartyService firstPartyService;
    @RequestMapping(value = "/add")
    public Object add(
            @RequestBody FirstParty firstParty
    ){
        return firstPartyService.add(firstParty);
    }
    @RequestMapping(value = "/edit")
    public Object edit(
            @RequestBody FirstParty firstParty
    ){
        return firstPartyService.edit(firstParty);
    }
    @RequestMapping(value = "/queryListPage")
    public Object queryListPage(
            @RequestParam(value = "companyId") Integer companyId,
            @RequestParam(value = "pageNo") Integer pageNo,
            @RequestParam(value = "pageSize",required = false,defaultValue = "10") Integer pageSize
    ){
        return firstPartyService.queryListPage(companyId,pageNo,pageSize);
    }
}
